Methods and devices for defective pixel detection

ABSTRACT

In a method of image signal processing, defective pixels are determined on-the-fly in a digital image representation based on a comparison of a pixel under evaluation with its surrounding pixels, with reference to a known resolving capability of a lens-sensor arrangement that captured the digital image representation. In response to the determination of defective pixels, the defective pixels are corrected.

FIELD OF INVENTION

Embodiments of the present invention relate to the field of defectivepixel detection in digital images. More specifically, embodiments of thepresent invention relate to a method and system for on-the-fly detectionof defective pixels in images processed within a digital camera.

BACKGROUND OF THE INVENTION

Imaging devices such as digital cameras and scanners contain one or moreimage sensors that are manufactured as CCD (Charge Coupled Device) orCMOS (Complementary Metal-Oxide Semiconductor) devices. The image sensoris composed of an array of sensing pixels that captures energy from anilluminant, often converting this energy into an electric measure suchas an intensity value. In most cases, imaging sensors will have acertain number of pixel locations that are “defective” due tofabrication or manufacturing errors. A defective pixel of a sensor isone which when exposed to an illuminant will produce a differentintensity value or response than that of a fully functional pixel whenexposed to that same illuminant. In other words, a defective pixel isabnormally sensitive or insensitive to light.

Pixel defects can be split into three categories: stuck-at-high,stuck-at-low, and abnormal-response. A stuck-at-high defective pixel isone that always responds to the lighting condition by producing a highintensity value. For instance, if the pixel intensity ranges from 0(low) to 255 (high), a stuck-at-high pixel may always respond tolighting with a value of 248, for example, even if actual measuredintensity for that location of the scene would be 31, 50, 100, etc., ifcaptured by a functional pixel. A stuck-at-low defective pixel is onethat always responds to the lighting condition by producing a lowintensity value. In the same system, a stuck-at-low defective pixel mayrespond, for example, with a value of 5 even though a functional pixelwould show the intensity value to be 200, 100, 78, etc. A pixel with anabnormal response defect has no absolute, but rather a relative variancefrom a functional pixel. A pixel with an abnormal response defect willinaccurately respond by a particular percentage, such that, where afunctional pixel will read a value X, the abnormal response defectivepixel will instead respond with a value of 0.25*X, for example. Theabnormal response is thus proportionally higher or lower relative to theintensity being captured. Pixels exhibiting any of these types ofdefects should, desirably, be corrected or compensated for.

Conventionally, the detection of defective pixels is performed in acontrolled environment, such as during sensor fabrication, or duringcamera initialization while the lens cap is still closed. The identifiedlocations are recorded and then transferred to some non-volatile memoryon the device in which the sensor is used, such as on a digital camera.The extra memory requirement adds cost and manufacturing complexity tothe whole camera system design.

One method of detecting defective pixels during camera operation appliesa statistical analysis technique. In the statistical analysis technique,a defective pixel is detected by a binary hypothesis testing scheme, inwhich, if the likelihood of P1 hypothesis (pixel belongs to “defective”class) is larger than that of P0 (pixel belongs to “normal” class), thepixel is categorized as “defective.” This method does not require memoryspace to record defective pixel locations, but some offline computationis still required. Additionally, multiple “training” images need to beused to obtain the accumulated likelihood ratio. The selection of thetraining images needs special care in order to avoid estimation bias.

A more arbitrary way of correcting image defects, which has also beenutilized to remove defective pixels during camera operation, is to notdetect the defective pixels, but filter out the unknown defects as noiseby applying an image-by-image noise removal technique to the entiresensor output (image). The challenge of defective pixel filtering comesfrom the fact that the distribution of the defective pixels is usuallyrandom and the defect locations are usually isolated. Using some form ofa linear low pass filter usually does not do well against this type ofnoise due to its impulse response nature. The result is that a largenumber of good pixels, or image details, get filtered out along with thebad pixels. The brute-force median or the ranked filter, even though agood solution for salt-and-pepper noise, can unfortunately also filterout image details along with the defects if the filter support islimited.

SUMMARY OF THE INVENTION

Accordingly, a need exists for defective pixel detection methods anddevices that can detect localized defects, without requiring largeamounts of memory to store data. A need also exists for a defectivepixel detection method and system that does not require extensiveprocessing power. A need also exists for defective pixel detectionmethods and devices that can operate quickly and efficiently within adigital imaging device. A need also exists for methods and devices fordetecting defective pixels that integrates with a means for correctingthe individual defective pixels. Various embodiments of the presentinvention, methods and devices for detecting defective pixels, providethese advantages along with other advantages described herein.

Generally, embodiments conceal the defective pixels by a two stageprocessing. The defective pixels are first detected on-the-fly by anonlinear process and then corrected by local interpolation. In oneexample the defective pixels are detected by two rules: (1) if the pixelunder consideration, when compared to its surrounding pixels, generatesa contrast or modulation that is significantly higher that the resolvingpower of the lens-sensor system in which the sensor resides; and (2) ifthe contrast is high along all spatial directions, e.g., the behavior issimilar to an impulse response, the pixel is very likely defective.

One embodiment of the present invention is a method of image signalprocessing. In this embodiment, defective pixels in a digital imagerepresentation are determined on-the-fly, based on a comparison of apixel under evaluation with its surrounding pixels, with reference to aknown resolving capability of a lens-sensor arrangement that capturedthe digital image representation; In response to the determination ofdefective pixels, the defective pixels are corrected. In one embodiment,a digital image representation in the form of a Bayer pattern array isreceived. In one embodiment, parameters describing the resolvingcapabilities of the lens-sensor arrangement are obtained. In oneembodiment, an average value is calculated of the same colored pixelssurrounding a pixel under evaluation in a portion of a digital imagerepresentation. It is then determined if the pixel under evaluation isin a flat image region or an edge image region. In one embodiment, theaverage value is calculated utilizing a modulation transfer functionthat is tailored for dark regions of images. In one embodiment,correcting the defective pixels comprises replacing each defective pixelwith a replacement pixel comprising an average value of same coloredpixels surrounding the defective pixel in a portion of the digital imagerepresentation.

In one embodiment of the method for image signal processing, thecomparison of a pixel under evaluation to with its surrounding pixelscomprises a comparison to a modified modulation transfer function uniqueto a lens-sensor arrangement used to generate the pixel underevaluation. In one embodiment, the comparison comprises comparing thepixel under evaluation to a modulation transfer function tailored forpixels in flat regions of images if the pixel under evaluation is in aflat image region. In one embodiment, the comparison comprises comparingthe pixel under evaluation to a modulation transfer function tailoredfor pixels in edge regions of images if the pixel under evaluation is inand edge image region. In one embodiment, the method comprisescomputer-readable code for causing a computer system to perform themethod of image signal processing.

According to one embodiment, an image signal processor device comprisesa surrounding pixel interpolator, a pixel evaluator, and a pixelreplacer. The surrounding pixel interpolator is for calculating anaverage value of same colored pixels surrounding a pixel underevaluation in a portion of a digital image representation. The pixelevaluator is coupled to the surrounding pixel interpolator. The pixelevaluator is for determining if the pixel under evaluation is defectivebased on a comparison of the pixel under evaluation with its surroundingpixels, with reference to a known resolving capability of a lens-sensorarrangement. The pixel evaluator is coupled to the pixel replacer. Thepixel replacer is configured for replacing each defective pixel with areplacement pixel comprising the average value calculated by thesurrounding pixel interpolator.

One embodiment also comprises a pixel location determiner. The pixellocation determiner is coupled to the pixel evaluator. The pixellocation determiner is for determining if the pixel under evaluation isin a flat image region or an edge image region. One embodiment of theimage signal processor device also comprises an image data receivercoupled to the surrounding pixel interpolator. The image data receiveris configured for receiving the digital image representation in the formof a Bayer pattern array. In one embodiment, the surrounding pixelinterpolator is configured to calculate the average value utilizing amodulation transfer function that is tailored for dark regions ofimages. In one embodiment, each replacement pixel comprises the averagevalue of the same colored pixels surrounding the defective pixel in theportion of the digital image representation. In one embodiment, thepixel evaluator is configured for determining if the pixel underevaluation is defective based on a comparison to a modified modulationtransfer function unique to the lens-sensor arrangement. In oneembodiment, the pixel evaluator is configured to utilize a modulationtransfer function tailored for pixels in flat regions of images whenevaluating a pixel in a flat image region. In one embodiment, the pixelevaluator is configured to utilize a modulation transfer functiontailored for pixels in edge regions of images when evaluating a pixel inan edge image region. One embodiment further comprises a memory elementthat comprises parameters that represent resolving capabilities of thelens-sensor arrangement.

According to one embodiment of the present invention, the image signalprocessing device is utilized in a digital imaging device, which alsocomprises an optical lens and an image sensor in addition to the imagesignal processor. In one embodiment, the image sensor comprises a ChargeCoupled Device (CCD). In one embodiment, the image sensor comprises aComplementary Metal Oxide Semiconductor (CMOS) device.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are incorporated in and form a part ofthis specification, illustrate embodiments of the invention and,together with the description, serve to explain the principles of theinvention:

FIG. 1 is a block diagram of an exemplary digital imaging device uponwhich embodiments of the present invention may be implemented.

FIG. 2 is a block diagram of an exemplary computer system upon whichembodiments of the present invention may be implemented.

FIG. 3 shows a block diagram of an exemplary image signal processordevice according to one embodiment of the present invention.

FIG. 4 shows a depiction of an exemplary Bayer pixel array upon whichembodiments of the present invention may be implemented.

FIG. 5 shows a depiction of an array of like colored pixels surroundinga pixel under evaluation, according to one embodiment of the presentinvention.

FIG. 6 shows an exemplary graph of a modulation transfer functionaccording to one embodiment of the present invention.

FIG. 7 shows a flowchart of a computer-controlled method for detectingand correcting a defective pixel in accordance with one embodiment ofthe present invention.

DETAILED DESCRIPTION

Reference will now be made in detail to various embodiments of theinvention, methods and devices for defective pixel detection, examplesof which are illustrated in the accompanying drawings. While theinvention will be described in conjunction with these embodiments, it isunderstood that they are not intended to limit the invention to theseembodiments. On the contrary, the invention is intended to coveralternatives, modifications and equivalents, which may be includedwithin the spirit and scope of the invention as defined by the appendedclaims. Furthermore, in the following detailed description of theinvention, numerous specific details are set forth in order to provide athorough understanding of the invention. However, it will be recognizedby one of ordinary skill in the art that the invention may be practicedwithout these specific details. In other instances, well known methods,procedures, components, and circuits have not been described in detailas not to unnecessarily obscure aspects of the invention.

Some portions of the detailed descriptions, which follow, are presentedin terms of procedures, steps, logic blocks, processing, and othersymbolic representations of operations on data bits that can beperformed on computer memory. These descriptions and representations arethe means used by those skilled in the image processing arts to mosteffectively convey the substance of their work to others skilled in theart. A procedure, computer executed step, logic block, process, etc., ishere, and generally, conceived to be a self-consistent sequence of stepsor instructions leading to a desired result. The steps are thoserequiring physical manipulations of physical quantities. Usually, thoughnot necessarily, these quantities take the form of electrical ormagnetic signals capable of being stored, transferred, combined,compared, and otherwise manipulated in a computer system. It has provenconvenient at times, principally for reasons of common usage, to referto these signals as bits, values, elements, symbols, characters, terms,numbers, or the like.

It should be borne in mind, however, that all of these and similar termsare to be associated with the appropriate physical quantities and aremerely convenient labels applied to these quantities. It is appreciatedthat throughout the present invention, discussions utilizing terms suchas “calculating” or “averaging” or “determining” or “receiving” or“evaluating” or “correcting” or “comparing” or “providing” or“replacing” or the like, refer to the action and processes of anelectronic system (e.g., digital imaging device 100 of FIG. 1, computersystem 212 of FIG. 2, or a similar electronic computing device), thatmanipulates and transforms data represented as physical (electronic)quantities within the electronic device's registers and memories intoother data similarly represented as physical quantities within theelectronic device memories or registers or other such informationstorage, transmission or display devices.

EMBODIMENTS OF THE INVENTION

Various embodiments of the present invention, methods and devices fordefective pixel detection, are described herein.

FIG. 1 is a block diagram of an exemplary digital imaging device 100. Itis appreciated that digital imaging device 100 described hereinillustrates an exemplary configuration of an operational platform uponwhich embodiments of the present invention can be implemented.Nevertheless, other digital imaging devices with differingconfigurations can also be used in place of digital imaging device 100within the scope of the present invention. That is, digital imagingdevice 100 can include elements other than those described inconjunction with FIG. 1.

Digital imaging device 100 includes an optical lens 110, which transmitsan illuminants 105 to an image sensor 120. Image sensor 120 isconfigured as an array and can be a Charge Coupled Device (CCD),Complementary Metal Oxide Semiconductor (CMOS) imaging device, or thelike. Image sensor 120 transmits analog image information via a couplingto analog-to-digital converter (ADC) 130, which can be optional ifsensor 120 is capable of outputting a digital image representation. ADC130 transmits a digital representation of image sensor data via coupling135 to Graphics Processor Unit (GPU) 140, image signal processor 145,and defective pixel detector 150. In one embodiment the digitalrepresentation of image sensor data carried via coupling 135 is adigital image representation in the form of an array of rows and columnsof digital data that comprise a pixel array pattern. The presentinvention is suited to work with an array of pixels received in the formof a Bayer array, a CYMG (Cyan, Yellow, Magenta, Green) array, RGBE(Red, Green, Blue, Emerald) array, 3CCD array (a single array from oneof three Charge Coupled Devices that capture the same image), Honeycombarray, or another form of pixel array. By way of explanation, and forsimplicity sake, functionality of the present invention is described inconjunction with only one of the arrays, an exemplary Bayer patternarray. It should be appreciated however, that the methods and devicesdescribed in the present invention are equally applicable to other pixelarray formats such as the CYMG array, the RGBE array, the 3CCD array,the Honeycomb array, and others.

Graphics Processor Unit (GPU) 140 is for processing sounds, stillimages, moving images, and the like. Image signal processor 145 is forprocessing raw image data into scan line image data that is then outputon signal line 155. In one embodiment, image signal processor 145detects and corrects defects in the raw image data that is input overline 135. Defective pixel detector 150 is for carrying out a process todetect defective pixels in the digital representation of the image datafrom sensor 120. The results from defective pixel detector 150 areoutput over line 155 to image signal processor 145, GPU 140, and otherportions of digital imaging device 100. In one embodiment of the presentinvention, some or all of the functions of defective pixel detector 150,image signal processor 145, and GPU 140 and can be implemented ascomputer readable code executed within digital imaging device 100, or alike device. In one embodiment of the present invention, some or all ofthe functions of defective pixel detector 150, image signal processor145, and GPU 140 and can be implemented in an a digital signal processorchip, an application specific integrated circuit (ASIC), or a likedevice within digital imaging device 100.

Outputs from defective pixel detector 150, image signal processor 145,and GPU 140 are carried on signal line 155. In one embodiment, signalline 155 can be a computer bus that also allows for user and systeminputs to defective pixel detector 150, image signal processor 145, andGPU 140. Optional mass memory 160 is also coupled to signal line 155.Mass memory 160 can be comprised of random access memory, a flash memorytype card, a compact flash card, a Secure Digital (SD) card, aMultiMedia Memory Card (MMC), a diskette, a hard disk drive, or thelike. In one embodiment, mass memory 160 is removable. Optional userinput 170 is also coupled to signal line 155. User input 170 cancomprise switches, buttons, joysticks, keyboards, electronic menus,touch pads, or other like means for providing user input to a digitaldevice. In one embodiment, user input 170 can allow for user selectionof options in defective pixel detector 150, image signal processor 145,and GPU 140.

Optional display 180 is also coupled to signal line 155. In oneembodiment, optional display 155 allows for the display of images anduser selectable options. Display 155 can be a liquid crystal display,plasma display, cathode ray tube, or like item for displaying images.Optional input/output device 190 is also coupled to signal line 155.Input/output device 190 can be a standard port such as a UniversalSerial Bus (USB) port, or a network adapter port. Digital imaging system100 can be contained within optional housing 102. In one embodiment,housing 102 can be shaped in the form of a camera body. In such anembodiment, digital imaging device 100 can operate as a digital camera,digital video camera, webcam, or the like. In one embodiment, digitalimaging device 100 is in the form of an image scanner. In oneembodiment, digital imaging system 100 also comprises a power supply(not shown) such as a battery or an alternating current adapter.

In FIG. 2, a block diagram of an exemplary computer system 212 is shown.In one embodiment, a purely software implementation of the presentinvention can be executed with a computer system such as computer system212. Computer system 212 can receive live or digitally recorded imagedata for detection and correction of defective pixels in accordance withthe method of the present invention. Image information can be received,for example, from an attached imaging device such as a digital camera,webcam, or scanner, via a data connection or via a removable memory.User inputs such as keyboards and cursor control devices allowuser-manipulation of user selectable inputs to the method of detectingand correcting defective pixels of the present invention. It isappreciated that computer system 212 described herein illustrates anexemplary configuration of an operational platform upon whichembodiments of the present invention can be implemented. Nevertheless,other computer systems with differing configurations can also be used inplace of computer system 212 within the scope of the present invention.That is, computer system 212 can include elements other than thosedescribed in conjunction with FIG. 2.

Computer system 212 includes an address/data bus 200 for communicatinginformation, a central processor 201 coupled with bus 200 for processinginformation and instructions; a volatile memory unit 202 (e.g., randomaccess memory [RAM], static RAM, dynamic RAM, etc.) coupled with bus 200for storing information and instructions for central processor 201; anda non-volatile memory unit 203 (e.g., read only memory [ROM],programmable ROM, flash memory, etc.) coupled with bus 200 for storingstatic information and instructions for processor 201. Computer system212 may also contain an optional display device 205 (e.g. a monitor,projector, or liquid crystal display) coupled to bus 200 for displayinginformation to the computer user. Moreover, computer system 212 alsoincludes a data storage device 204 (e.g., disk drive) for storinginformation and instructions.

Also included in computer system 212 is an optional alphanumeric inputdevice 206. Device 206 can communicate information and commandselections to central processor 201. Computer system 212 also includesan optional cursor control or directing device 207 coupled to bus 200for communicating user input information and command selections tocentral processor 201. Computer system 212 also includes signalcommunication interface (input/output device) 208, which is also coupledto bus 200, and can be a serial port. Communication interface 208 mayalso include wireless communication mechanisms. Using communicationinterface 208, computer system 212 can be communicatively coupled toother computer systems over a communication network such as the Internetor an intranet (e.g., a local area network).

Also included in computer system 212, and coupled to bus 200, is anoptional removable storage device 210 such as a flash memory type card,a compact flash card, a Secure Digital (SD) card, a MultiMedia MemoryCard (MMC), a diskette, a removable hard disk drive, or the like.Computer system 212 also includes an optional optical input device 211,coupled to bus 200, such as a digital imaging device, a digital camera,a webcam, a video camera, an image scanner, a Charge Coupled Device(CCD), a Complementary Metal Oxide Semiconductor (CMOS) imaging device,or the like.

FIG. 3 shows a block diagram of an exemplary image signal processor 145according to one embodiment of the present invention. Image signalprocessor 145 is used for detecting and correcting defective pixels, onthe fly by comparing a pixel under evaluation with surrounding pixels,with reference to known capabilities regarding the resolving power ofthe lens-sensor arrangement used to generate the pixels. Block 301provides information about the capabilities of the lens-sensor systemused to capture image data for processing in image signal processor 145.This information contains parameters in the form of a modulationtransfer function or modified modulation transfer functions (discussedlater in more detail) for the lens-sensor system. These parameters canbe calculated within the image sensing device, but are preferablypre-calculated in a manufacturing or factory type environment and storedfor use by image signal processor 145. Block 301 can comprise a memoryfor storing parameters describing the resolving capability of thelens-sensor in use or a processor for calculating parameters describingthe resolving capability of the lens-sensor in use, and can be coupledexternally to image signal processor 145 (as shown), or alternativelylocated within image signal processor 145.

As previously described in conjunction with FIG. 1, portions or all ofimage signal processor 145 can be implemented in software or hardware.Image signal processor 145 is comprised of an optional image datareceiver 305, which is used for receiving digital image data in a scanline fashion, one row of a pixel array at a time. Image data receiver305 is coupled to image sensor data line 135 for receiving image data,and optionally to an image data buffer 330 for temporarily storing rowsof received image data. Image data receiver 305 is also coupled to adefective pixel detector 150, and provides rows of image data todefective pixel detector 150 as required. Defective pixel detector 150is for detecting defective pixels in streams of image data. Defectivepixel detector 150 can be coupled to the optional image data receiver305, or to image sensor data line 135 if image data receiver 305 is notutilized. Defective pixel detector 150 is also coupled optional pixelreplacer 325, or to signal line 155 if pixel replacer 325 is notutilized. Optional pixel replacer 325 is for replacing, with replacementpixels, any defective pixels that are detected by defective pixeldetector 150. Pixel replacer 325 is coupled to signal line 155 foroutput, in scan line fashion, of a digital representation of an imagethat has had defective pixels detected and replaced.

Defective pixel detector 150 is comprised of a surrounding pixelinterpolator 310, a pixel location detector 315, and a pixel evaluator320. Surrounding pixel interpolator 310 is for determining the averagevalue of the contrast of like colored pixels surrounding a pixel underevaluation. Surrounding pixel interpolator can be coupled to optionalimage data receiver 305 or to image data sensor line 135 if image datareceiver 305 is not used. If an image data receiver is not used,surrounding pixel interpolator performs the functions image datareceiver 305. Surrounding pixel interpolator 310 can also optionally becoupled with pixel replacer 325 for providing information about theaverage value of pixels surrounding a pixel under evaluation.Surrounding pixel interpolator 310 is also coupled with pixel locationdeterminer 315 and pixel evaluator 320. Pixel location determiner 315 isused to determine if a pixel under evaluation is in an edge region or aflat region (not an edge) of a digital image representation. Pixellocation determiner 315 is coupled to pixel evaluator 320. Pixelevaluator 320 serves to evaluate whether or not a pixel under evaluationis defective or not by making a comparison to a modified modulationtransfer function. Pixel evaluator 320 can be coupled to optional pixelreplacer 325 for replacing a detected defective pixel, or if pixelreplacer 325 is not used, to signal line 155 for output of informationregarding defective pixels.

Modulation transfer function parameters can be utilized in surroundingpixel interpolator 310, pixel location determiner 315, and pixelevaluator 320. These modulation transfer function parameters can begenerated within the system that image signal processor 145 is part of,or can be pre-calculated, stored for use, and provided via a link theparameters. For instance, surrounding pixel interpolator 310, pixellocation determiner 315, and pixel evaluator 320 are shown coupled toblock 301 to obtain parameters regarding the resolving capabilities ofthe lens-sensor utilized to generate the pixels being processed.

Image data receiver 305 is coupled to image sensor data line 135 forreceiving image data, and optionally to an image data buffer 330 fortemporarily storing rows of received image data. Image data is receivedas a digital image representation in the form of scan lines, or rows ina pixel array. In one embodiment, the pixel array can be in the form ofa Bayer pattern. In other embodiments of the present invention, imagedata is receives as a digital image in the form of a CYMG array, a RGBEarray, a 3CCD array, a Honeycomb array, or some other form of array. Inan embodiment utilizing a Bayer patter pixel array, if image data buffer305 is used, it is of sufficient size to buffer a minimum of four rowsof data from the largest Bayer pixel array that can be sent from sensor120 (FIG. 1) or ADC 130 (FIG. 2) over signal line 135. If other pixelarray patterns are used, the minimum size will be dependent up on thenumber of lines of data needed to begin processing. If an input databuffer is not used, image data receiver 305 also performs the functionsof image data buffer 330 in addition to its other functions.

FIG. 4 shows a depiction of an exemplary Bayer pixel array 400 uponwhich embodiments of the present invention may be implemented. Bayerpixel array 400 is shown with twelve rows and twelve columns, but can besmaller or much larger. Pixels of four different colors (color channels)are represented by different letters such as; “R,” “B,” “Gr,” and “Gb.”The term pixel as used in the descriptions of the present invention,refers to a single color unit of a single color channel, such as pixel405 that is circled in array 400. The pixels are arranged in a specificorder in Bayer pixel array 400 such that only two of the four colorsappear in any row or column, and those two colors of pixels repeatedlyalternate such that two pixels the same color, such as “R,” are onlyseparated by one pixel of another color, in any horizontal, vertical, ordiagonal direction. Areas 401, 402, 403, and 404 represent two-by-twopixel clusters of four different colors of pixels that are separatedfrom each other by a minimum of four pixels in every horizontal,vertical, and diagonal direction.

Referring again to FIG. 3, surrounding pixel interpolator 310 is fordetermining the average value of the contrast of like colored pixelsthat surround a pixel under evaluation in a pixel array. In oneembodiment of the present invention, surrounding pixel interpolator 310is used to evaluate a Bayer pattern array of pixels. In otherembodiments, surrounding pixel interpolator 310 is used to evaluatepixel arrays in other formats, such as a CYMG array, RGBE array, 3CCDarray, Honeycomb array, or some other form of array.

FIG. 5 shows a depiction of an array 500 of like colored pixels (P1-P8)surrounding a pixel under evaluation “X,” according to one embodiment ofthe present invention. Array 500 is a five row (Row 1-Row 5) by fivecolumn (Col. 1-Col. 5) subset of a Bayer pixel array, such as Bayerpixel array 400. Pixel “X” and P1 through P8 are of like color, as canbe seen from their placement in the pixel array 500. P1 through P8 arethe nearest pixels of like color that surround pixel “X” in thehorizontal, vertical, and diagonal direction in array 500. An array suchas array 500 is normally received from an image sensor (such as sensor120) or an analog-to-digital converter (such as ADC 135) in scan linefashion, one row at a time. For instance, all of the pixels in Row 1would be received first, then the pixels in Row 2, then the pixels inRow 3, then the pixels in Row 4, and finally the pixels in Row 5. Eachpixel is received digitally and has a certain period associated with theperiod of its sample. This period is shown by the “T” and “2T”demarcations below array 500. As represented, pixel “X” is in a flatimage region, or better put, not on an edge region of an image. If pixel“X” were on an edge region of a representation of image data, up to tworows and/or columns could be missing from array 500. For instance, in aworst-case edge region scenario where Row 1, Row 2, Col. 1, and Col. 2are missing from the array, pixel “X” is now in the upper left corner ofthe array, and is only surrounded on three of eight sides by pixels oflike color, namely P5, P7, and P8. Many other edge region arrangementsare possible where pixel “X” is in the corner of an array, or else anedge crosses through the five-by-five pixel array normally surroundingpixel “X.”

Referring again to surrounding pixel interpolator 310 of FIG. 3 and alsoto FIG. 4, the average image contrast value is calculated for likecolored pixels surrounding pixel “X,” which is under evaluation, in eachhorizontal, vertical, and diagonal direction. In one embodiment of thepresent invention, this average value can be calculated for P1 throughP8, the like colored pixels surrounding “X” in array 500, with anequation such as the equation shown in Table 1.

TABLE 1 Exemplary Equation for Average Value of Pixel Contrast${Avg} = {\left( {\sum\limits_{i = 1}^{8}\;{Pi}} \right)/8}$

After the average (Avg) value for the surrounding pixels is calculated,surrounding pixel interpolator 310 also calculates the minimumderivative among the eight possible directions from “X,” to find out howmuch the contrast of pixel “X” differs from the contrast of itssurrounding like colored pixels. In one embodiment of the presentinvention, this minimum derivative between pixel “X” and P1 through P8can be calculated with an equation such as the equation shown in Table2.

TABLE 2 Exemplary Equation for Minimum Derivative$D_{\min} = {\min\limits_{i = {1\sim 8}}{{{Pi} - X}}}$

Surrounding pixel interpolator 310 passes information about “Avg” and“D_(min)” along to pixel location determiner 315 and pixel evaluator320. In one embodiment, information about the “Avg” is also coupled tooptional pixel replacer 325.

Pixel location determiner 315 is used to determine if a pixel underevaluation is in an edge region or a flat region (not an edge) of adigital image representation. To do this some sort of edge detection isapplied to pixel “X” (FIG. 5) under evaluation, and the surrounding likecolored pixels, P1 through P8 (also shown in FIG. 5). Edge detectiontakes place to reduce the number of false positives among the defectivepixels that are detected by pixel evaluator 320. By knowing whether apixel “X” is in an edge region or has an edge region intruding on thefive by five pixel array that surrounds it, pixel evaluator 320 can takeinto account the location of the pixel under evaluation when performingcalculations to determine if it is defective. Tables 3 and 4 show a setof two exemplary equations that can be used in combination to determineif a pixel under evaluation is in a flat region of image data, or anedge region of image data. In other embodiments of the presentinvention, other means of edge detection besides those shown in Tables 3and 4 can also be used.

TABLE 3 Exemplary Equation for Maximum Contrast Derivative$C_{\max} = {\max\limits_{i = {1\sim 8}}{{{Pi} - {Avg}}}}$

The equation of Table 3 is used to determine “C_(max),” or the maximumcontrast derivative away from the “Avg” contrast of the pixels P1through P8, which was calculated from the formula in Table 1. The valuefor “C_(max)” is carried forward by pixel location determiner 315 andused in an edge detection equation such as the exemplary equation shownin Table 4.

In the equation shown in Table 4, the value of “C_(max)” is taken fromthe equation of Table 3, the value of Avg is taken from the equation ofTable 1, and the value of “L_(flat)%” is taken from an adjustedmodulation transfer function that is calculated for the lens/sensorarrangement utilized to capture pixel “X,” the pixel under evaluation.If the result of the equation of Table 4 is found to be true, then thefive by five pixel area surrounding pixel “X,” is considered to be in aflat image region. If the result of the equation is false, then it isassumed that there is an image edge somewhere within the five by fivepixel region surrounding pixel “X.” Information about whether a pixelunder evaluation is in a flat region or an edge region of an imagerepresentation is forwarded on to pixel evaluator 320.

TABLE 4 Exemplary Equation for Edge Detection$\frac{C_{\max}}{Avg}\underset{\_}{<}{L_{flat}\%}$

FIG. 6 shows an exemplary graph 600 of a modulation transfer functionaccording to one embodiment of the present invention. Modulationtransfer functions are used to describe how many image details and howmuch sharpness a particular lens-camera or lens-sensor arrangement canprovide as compared to the amount of detail and sharpness in an actualimage. Modulation transfer functions are well known in the art ofimaging, and are normally calculated in a lab or factory type setting sothat a frequency response capability for a lens-sensor arrangement canbe known. The X-axis of graph 600 represents normalized spatialfrequency in units such as line pairs per millimeter. The Y-axis ofgraph 600 represents a contrast response in percentage of achievablecontrast (ranging from 0% to 100%).

In FIG. 6, curved line “L” represents the response of the lens-sensorarrangement, and is the actual graph of the modulation transferfunction. The shaded area to the right of “L” represents contrast thatis beyond the capability of the lens-sensor arrangement. The un-shadedarea to the left of “L” represents contrast that is achievable with thelens-sensor arrangement. The curved line “L+d” represents an adjustedmodulation transfer function with a pre-set tolerance factor “d” addedin to adjust for noise. Different such tolerance factors can be added inmanufacture, test, or assembly to alter the actual modulation transferfunction for use in certain non-ideal real-world situations. Forinstance, a small tolerance, “d,” of a few percent may be added to L toachieve a value “L_(flat),” for use when determining the maximumcontrast of a pixel in a flat region of an image. A larger tolerance,“d,” of for instance 10% may be added to L to achieve a value“L_(edge),” for use when determining the maximum contrast of a pixel inan edge region of an image. Finally, a very large tolerance, “d,” of forinstance 80% may be subtracted from “L” to achieve a value, “L_(dark),”for use when determining the maximum contrast of a pixel in an imagetaken in low light conditions, thus giving a value of “L_(dark),” thatrepresents only 20% of the dynamic range of the lens-sensor arrangement.

Values for “L_(flat),” “L_(edge),” and “L_(dark)” are assigned to alens-sensor arrangement in a factory, lab, assembly stage, or likesetting, and are utilized by image signal processor 145 and defectivepixel detector 150 (both shown in FIGS. 1 and 3). In some embodiments ofthe present invention, the constant values of “d” used to create to“L_(flat),” “L_(edge),” and “L_(dark)” may be user alterable via userinput such as user input 170 (FIG. 1).

Referring again to FIG. 3, pixel evaluator 320 serves to evaluatewhether or not a pixel under evaluation is defective or not by making acomparison to a modified modulation transfer function such as “L_(flat)”or “L_(edge).” Table 5 shows an exemplary equation for evaluating apixel in a flat image region to determine if it will be classified asdefective. The value of “Avg” is taken from the equation shown in Table1, the value of “D_(min)” is taken from the equation shown in Table 2.Both the values of “Avg” and “D_(min)” are forwarded from surroundingpixel interpolator 310. The adjusted modulation transfer function valuefor the frequency (1/T) of pixel “X” under evaluation is “L_(flat)%” asdetermined from a graph or equation for an adjusted modulation transferfunction, such as graph 600. If the result of the comparison done viathe equation of Table 5 is true, then pixel “X” under evaluation isconsidered a defective pixel. Pixel evaluator 325 forwards informationabout a pixel determined as defective to optional pixel replacer 325, orif pixel replacer 325 is not utilized, onward for other uses via signalline 155.

TABLE 5 Exemplary Equation for Determining if a Pixel in a Flat Regionis Defective $\frac{D_{\min}}{Avg} > {L_{flat}\%}$

Likewise, Table 6 shows an exemplary equation for evaluating a pixel inan edge image region to determine if it will be classified as defective.The value of “Avg” is taken from the equation shown in Table 1, thevalue of “D_(min)” is taken from the equation shown in Table 2. Both thevalues of “Avg” and “D_(min)” are forwarded from surrounding pixelinterpolator 310. The adjusted modulation transfer function value forthe frequency (1/T) of pixel “X” under evaluation is “L_(edge)%” asdetermined from a graph or equation for an adjusted modulation transferfunction, such as graph 600. If the result of the comparison done viathe equation of Table 6 is true, then pixel “X” under evaluation isconsidered a defective pixel. Pixel evaluator 325 forwards informationabout a pixel determined as defective to optional pixel replacer 325, orif pixel replacer 325 is not utilized, onward for other uses via signalline 155.

TABLE 6 Exemplary Equation for Determining if a Pixel in an Edge Regionis Defective $\frac{D_{\min}}{Avg} > {L_{edge}\%}$

Defective pixel detector 150 evaluates each pixel in an image streamsuccessively, on-the-fly, as received. A determination is made as towhether a pixel is defective based on the pixel's modulation as comparedto its surrounding pixels being higher than the resolving power of thelens-sensor system used to generate it. The simplicity of thecalculations involved reduces the processing power needed to identifybad pixels, and increases the speed of detection. Because of the needfor information about surrounding pixels, some small bufferingcapability for a minimum number of data rows of an array is required.For instance, in an embodiment of the present invention that evaluates aBayer pattern array of pixels, a buffering capacity for four rows of theBayer pixel array, beyond the row currently being received, is requiredto ensure enough information exists for evaluating the received pixels.If this buffering capability is not provided via image data receiver 305or image data buffer 305, it is provided by or accessed from withindefective pixel detector 150. The procedure used by defective pixeldetector 150 detects “isolated” defective pixels. The eight same-colorpixels (for example P1 through P8 of FIG. 5) surrounding the evaluatedpixel must not be defective, which means the minimal distance betweentwo defective pixels on the same color channel is four pixels apart. Thedefective pixels of different color channels, on the other hand, can beadjacent to each other, since there is no cross-color information usedin the proposed procedure. That is, the present invention can detect andcorrect two-by-two bad pixel clusters. FIG. 4 illustrates four examplesof two-by-two bad pixel clusters (401, 402, 403, and 404) and theirminimum distances from one another.

Optional pixel replacer 325 is for replacing, with replacement pixels,any defective pixels that are detected by defective pixel detector 150.Pixel replacer 325 is coupled to signal line 155 for output, in scanline fashion, of a digital representation of an image that has haddefective pixels detected and replaced. Many methods of generating areplacement pixel may be utilized. To saving on memory and processingpower, the current invention replaces a pixel that has been evaluated asdefective with an average value of the same colored pixels (P1 throughP8 of FIG. 5) that surrounded the evaluated pixel. This “Avg” can berecalculated using an equation such as the equation shown in Table 1, orsimply supplied through some coupling to surrounding pixel interpolator310. Once the defective pixels in an image stream have been replaced, animage stream is output in scan line fashion from pixel replacer 325 viasignal line 155.

In one embodiment of the present invention, a modification can be madeto increase noise tolerance in low light level regions of images. Bydoing this, the modulation transfer function is no longer utilized insome low light scenarios by portions of defective pixel detector 150.Table 7 shows an equation that can be used to replace the equation ofTable 1. This equation adds an extra step as compared to the equation ofTable 1, and thus returns as “Avg,” the greater of the average value ofP1 through P8, or the value of “L_(dark)” for pixel “X,” which is underevaluation. If the default value of “L_(dark)” is ever returned as“Avg,” then if the defective pixel evaluator 150 reverts to a previouslyknown method for determining defective pixels, such as utilizing a lowpass filter, instead of using pixel location determiner 315 and pixelevaluator 320. Pixels marked as defective are passed on via signal line155 or to optional pixel replacer 325, which operates in the samefashion as previously described.

TABLE 7 Exemplary Equation for Average Value of Pixel Contrast,Optimized for Noise Tolerance in Dark Image Regions${Avg} = {\max\left\lbrack {{\left( {\sum\limits_{i = 1}^{8}\;{Pi}} \right)/8},L_{dark}} \right\rbrack}$

FIG. 7 shows a flowchart 700 of a computer-controlled method fordetecting and correcting a defective pixel in accordance with oneembodiment of the present invention. Although specific steps aredisclosed in flowchart 700, such steps are exemplary. That is,embodiments of the present invention are well suited to performingvarious other (additional) steps or variations of the steps recited inflowchart 700. It is appreciated that the steps in flowchart 700 may beperformed in an order different than presented, and that not all of thesteps in flowchart 700 may be performed. In one embodiment, flowchart700 is implemented as computer-readable program code stored in a memoryunit of computing device such as computer system 212 (FIG. 2) or digitalimaging device 100 (FIG. 1), and executed by processor 201 (FIG. 1),image signal processor 145 (FIG. 2), or a like device.

In FIG. 7, in one embodiment of the present invention, 705 of flowchart700 shows obtaining or computing parameters describing the resolvingcapabilities of the lens-sensor system in use. This function is providedfor and described in conjunction with block 301 of FIG. 3. It includesobtaining or computing parameters such as the modulation transferfunction for the lens-sensor arrangement that is being used to generatethe pixels that are being evaluated. It also includes obtaining orcomputing parameters such as modified modulation transfer functionstailored for flat image regions, edge image regions, or dark imageregions. If this information is pre-calculated, it can be provided asrequired to the image signal processor stages via memory, otherwise itcan be calculated using known and described methods.

In one embodiment of the present invention, 710 of flowchart 700 showsthat a digital image representation is received in the form of rows in aBayer pattern array. In other embodiments of the present invention, adigital image representation is received as an array of pixels in theform of a CYMG array, RGBE array, 3CCD, Honeycomb array, or some otherform of array. This receiving of a digital image representation isdescribed in conjunction with image data receiver 305 (FIG. 3), imagedata buffer 330 (FIG. 3), defective pixel detector 150 (FIGS. 1 and 3),and surrounding pixel interpolator 310 (FIG. 3).

In one embodiment of the present invention, 720, of flowchart 700 showsthat an average value of same colored pixels surrounding a pixel underevaluation in a portion of a digital image representation is calculated.This calculating of an average value corresponds to the descriptionsgiven in conjunction with FIG. 5, surrounding pixel interpolator 310(FIG. 3), and the equations shown and described in conjunction withTable 1 and Table 7. In some embodiments, this calculation of theaverage value is done utilizing a modulation transfer function that istailored for dark regions of images.

In one embodiment of the present invention, 730 of flowchart 700 showsdetermining if the pixel under evaluation is in a flat image region oran edge image region. This flat/edge determination corresponds to thedescriptions of the equations shown in Tables 3 and 4, and alsocorresponds to the descriptions given in conjunction with FIG. 5 andpixel location determiner 315 (FIG. 3).

In one embodiment of the present invention, 740 of flowchart 700 showsdetermining if the pixel under evaluation is defective based on thepixel's modulation as compared to its surrounding pixels being higherthan the resolving power of the lens-sensor system used to generate thepixel. This defective pixel determination corresponds to thedescriptions given in conjunction with pixel evaluator 320 (FIG. 3), andthe equations shown and described in conjunction with Tables 1, 2, 5 and6. Additionally, in some embodiments, where the pixel under evaluationis in suitably dark image region, and the equation of Table 7 is used tocalculate the “Avg” value of pixels surrounding the pixel underevaluation, a method such as a low pass filter can also be used toevaluate for defective pixels. In one embodiment, information regardingthe average value of same colored pixels surrounding the pixel underevaluation and information about the minimum derivative between thepixel under evaluation and its surrounding like colored pixels isutilized in the determination. In one embodiment, information aboutwhether the pixel is in an edge region or a flat region of an image isalso used, so that a modulation transfer function tailored for edgeimage regions or flat image regions, as appropriate, can be utilized inthe determination.

In one embodiment of the present invention, 750 of flowchart 700 showsreplacing a defective pixel with a replacement pixel. Generation of areplacement pixel and replacement of a pixel that has been evaluated asdefective are both described in conjunction with pixel replacer 325(FIG. 3), and further in conjunction with the descriptions of theequations of Tables 1 and 7. In one embodiment, a defective pixel isreplaced with a pixel of average value as calculated by the equation ofTable 1. In one embodiment, a defective pixel can also be replaced witha pixel of average value as calculated by the equation of Table 7.

Various embodiments of the invention, methods and devices for defectivepixel detection, are thus described. While the present invention hasbeen described in particular embodiments, it should be appreciated thatthe invention should not be construed as limited by such embodiments,but rather construed according to the below claims.

What is claimed is:
 1. A method of image signal processing for a digitalimaging device comprising: determining, in an electronic system,defective pixels on-the-fly in a digital image representation based on acomparison of a contrast of a pixel under evaluation with a contrast ofits surrounding pixels, with reference to a known resolving capabilityof a lens-sensor arrangement that captured said digital imagerepresentation, wherein said determining includes: if said pixel underevaluation is in a flat image region, increasing said known resolvingcapability by a first percentage, if said pixel under evaluation is inan edge image region, increasing said known resolving capability by asecond percentage greater than said first percentage, and if saiddigital image representation is captured in a low light level condition,decreasing said known resolving capability by a third percentage greaterthan said second percentage; and in response to said determinationcorrecting said defective pixels.
 2. The method of image signalprocessing of claim 1 further comprising receiving said digital imagerepresentation in the form of a Bayer pattern array.
 3. The method ofimage signal processing of claim 1 further comprising obtainingparameters describing the resolving capabilities of said lens-sensorarrangement.
 4. The method of image signal processing in claim 1 furthercomprising: calculating an average value of same colored pixelssurrounding said pixel under evaluation in a portion of said digitalimage representation; and determining if said pixel under evaluation isin said flat image region or said edge image region.
 5. The method ofimage signal processing of claim 4 wherein said average value iscalculated utilizing a modulation transfer function that is tailored fordark regions of images.
 6. The method of image signal processing ofclaim 1 wherein said correcting said defective pixels comprisesreplacing each said defective pixel with a replacement pixel comprisingan average value of same colored pixels surrounding said defective pixelin a portion of said digital image representation.
 7. The method ofimage signal processing of claim 1 wherein said comparison comprises acomparison to a modified modulation transfer function unique to saidlens-sensor arrangement.
 8. The method of image signal processing ofclaim 7 wherein said comparison comprises comparing said pixel underevaluation to a modulation transfer function tailored for pixels in flatregions of images if said pixel under evaluation is in said flat region.9. The method of image signal processing of claim 7 wherein saidcomparison comprises comparing said pixel under evaluation to amodulation transfer function tailored for pixels in edge regions ofimages if said pixel under evaluation is in said edge region.
 10. Animage signal processor device for a digital imaging device comprising: asurrounding pixel interpolator for calculating an average value of samecolored pixels surrounding a pixel under evaluation in a portion of adigital image representation; a pixel evaluator coupled to saidsurrounding pixel interpolator, said pixel evaluator for determining ifsaid pixel under evaluation is defective based on a comparison of acontrast of said pixel under evaluation with a contrast of itssurrounding pixels, with reference to a known resolving capability of alens-sensor arrangement that captured said digital image representation,if said pixel under evaluation is in a flat image region, said knownresolving capability is increased by a first percentage, if said pixelunder evaluation is in an edge image region, said known resolvingcapability is increased by a second percentage greater than said firstpercentage, and if said digital image representation is captured in alow light level condition, said known resolving capability is decreasedby a third percentage greater than said second percentage; and a pixelreplacer coupled to said pixel evaluator, wherein said pixel replacer isconfigured for replacing each defective pixel with a replacement pixelcomprising said average value calculated by said surrounding pixelinterpolator, and wherein said pixel replacer is coupled to a memorycomponent.
 11. The image signal processor device of claim 10 furthercomprising a pixel location determiner coupled to said pixel evaluator,said pixel location determiner for determining if said pixel underevaluation is in said flat image region or said edge image region. 12.The image signal processor device of claim 10 further comprising animage data receiver coupled to said surrounding pixel interpolator,wherein said image data receiver is configured for receiving saiddigital image representation in the form of a Bayer pattern array. 13.The image signal processor device of claim 10 further comprising amemory element that comprises parameters that represent resolvingcapabilities of said lens-sensor arrangement.
 14. The image signalprocessor device of claim 10 wherein said surrounding pixel interpolatoris configured for calculating said average value utilizing a modulationtransfer function that is tailored for dark regions of images.
 15. Theimage signal processor device of claim 10 wherein said pixel evaluatoris configured for determining if said pixel under evaluation isdefective based on a comparison to a modified modulation transferfunction unique to said lens-sensor arrangement.
 16. The image signalprocessor device of claim 15 wherein said pixel evaluator is configuredto utilize a modulation transfer function tailored for pixels in flatregions of images when said pixel under evaluation is in said flat imageregion.
 17. The image signal processor device of claim 15 wherein saidpixel evaluator is configured to utilize a modulation transfer functiontailored for pixels in edge regions of images when said pixel underevaluation is in said edge image region.
 18. A digital imaging devicecomprising: an optical lens; an image sensor coupled to said lens, saidimage sensor for capturing a digital image representation; and an imagesignal processor coupled to said image sensor, said image signalprocessor comprising: a surrounding pixel interpolator for calculatingan average value of same colored pixels surrounding a pixel underevaluation in a portion of said digital image representation; a pixelevaluator coupled to said surrounding pixel interpolator, said pixelevaluator for determining if said pixel under evaluation is defectivebased on a comparison of a contrast of said pixel under evaluation witha contrast of its surrounding pixels, with reference to a knownresolving capability of a lens-sensor arrangement that captured saiddigital image representation, if said pixel under evaluation is in aflat image region, said known resolving capability is increased by afirst percentage, if said pixel under evaluation is in an edge imageregion, said known resolving capability is increased by a secondpercentage greater than said first percentage, and if said digital imagerepresentation is captured in a low light level condition, said knownresolving capability is decreased by a third percentage greater thansaid second percentage; and a pixel replacer coupled to said pixelevaluator, wherein said pixel replacer is configured for replacing eachdefective pixel with a replacement pixel comprising said average valuecalculated by said surrounding pixel interpolator.
 19. The device ofclaim 18 further comprising a pixel location determiner coupled to saidpixel evaluator, said pixel location determiner for determining if saidpixel under evaluation is in said flat image region or said edge imageregion.
 20. The device of claim 18 further comprising an image datareceiver coupled to said surrounding pixel interpolator, wherein saidimage data receiver is configured for receiving said digital imagerepresentation in the form of a Bayer pattern array.
 21. The method ofimage signal processing of claim 1 wherein said contrast of saidsurrounding pixels comprises an average contrast of like colored pixelssurrounding said pixel under evaluation.